import request from "@/utils/request";

// 查询预警信息列表
export function listEarlyWarning(query) {
  return request({
    url: "/system/earlyWarning/list",
    method: "get",
    params: query,
  });
}

// 查询预警信息详细
export function getEarlyWarning(id) {
  return request({
    url: "/system/earlyWarning/" + id,
    method: "get",
  });
}
export function selectEarlyWarningList(query) {
  return request({
    url:
      "/dataAccess/selectEarlyWarningList?pageNum=" +
      query.pageNum +
      "&pageSize=" +
      query.pageSize,
    method: "post",
    data: query,
  });
}
// 新增预警信息
export function addEarlyWarning(data) {
  return request({
    url: "/system/earlyWarning",
    method: "post",
    data: data,
  });
}

// 修改预警信息
// export function updateEarlyWarning(data) {
//   return request({
//     url: '/system/earlyWarning',
//     method: 'put',
//     data: data
//   })
// }

// 删除预警信息
export function delEarlyWarning(id) {
  return request({
    url: "/system/earlyWarning/" + id,
    method: "delete",
  });
}

// 修改预警信息
export function updateEarlyWarning(data) {
  return request({
    url: "/system/warning",
    method: "put",
    data: data,
  });
}
